using EasyXaf.EntityDesigner.Editors.DetailViewEditors.Models;
using Microsoft.AspNetCore.Components;

namespace EasyXaf.EntityDesigner.Editors.DetailViewEditors.Components;

public partial class LayoutDesignerComponent
{
    [Parameter]
    public string CssClass { get; set; }

    [Parameter]
    public LayoutDesigner LayoutDesigner { get; set; }

    [Parameter]
    public EventCallback LayoutChanged { get; set; }

    protected override void OnInitialized()
    {
        base.OnInitialized();

        LayoutDesigner.LayoutChanged += async (s, e) =>
        {
            await LayoutChanged.InvokeAsync(LayoutDesigner);
        };
    }
}